<?php

use yii\helpers\Html;
use app\models\Grade;
use app\models\Department;
use app\models\Professional;
use app\models\Classes;
use yii\widgets\ActiveForm;
/**
 * @var yii\web\View $this
 * @var app\models\Message $model
 * @var yii\widgets\ActiveForm $form
 */
?>

<blockquote class="meta">
<h2><?php echo Yii::t('Message','Group Compose') ?></h2>
</blockquote>

<div class="message-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'grade')->dropDownList(Grade::getDataList(),['prompt'=>'请选择','onchange'=>'getGradeSelectValue(this)'])?>
<div id ="showup" style="display:none">
    <?= $form->field($model, 'department')->dropDownList(Department::getDataList(),['prompt'=>'请选择','id'=>'user-department','onchange'=>'getDepSelectValue(this)','url'=>yii::$app->urlManager->createUrl('department/select')])?>

    <?= $form->field($model, 'professional')->dropDownList([],['prompt'=>'请选择','id'=>'user-professional','onchange'=>'getProSelectValue(this)','url'=>yii::$app->urlManager->createUrl('professional/select')])?>

    <?= $form->field($model, 'class')->dropDownList([],['prompt'=>'请选择','id'=>'user-class'])?>
</div>
    <?= $form->field($model, 'title')->textInput(['value'=>'群发信息']) ?>

    <?= $form->field($model, 'content')->textArea() ?>

    <?php echo Html::submitButton(yii::t('Message','Sent'), ['onClick'=>'return sentmessage()', 'class' => 'btn btn-success pull-right','style'=>"width:20%"]);?>
    <?php ActiveForm::end(); ?>
</div>
